//专门为Count组件生成action对象
import { INCREMENT, DECREMENT } from '../constant';
// import store from './store';

//同步action，action的值为Object类型的一般对象
export const createIncrementAction = data => ({ type: INCREMENT, data });
export const createDecrementAction = data => ({ type: DECREMENT, data });

//所谓的异步action，就是按才提哦那的值为函数 异步action一般会调用同步
export const createIncrementAsyncAction = (data, time) => { 
  return (dispath) => {
    setTimeout(() => {
      dispath(createIncrementAction(data));
    }, time);
  }
}